<!DOCTYPE html>
<meta charset="UTF-8">
<table id="dg_custompager" data-type="grid" title="客户端分页"
	data-define="rownumbers:true,singleSelect:true,pageSize:20,pagination:true,
		method:'get',
		url: '${rc.contextPath}/assets/ui/jww/demo/testdata/grid_data1.json',
		onLoadSuccess:setCustomerButton,
		fit:true,fitColumns:true
		">
	<thead>
		<tr>
			<th data-define="field:'itemid',width:80">ID</th>
			<th data-define="field:'productid',width:200">产品名称</th>
			<th data-define="field:'listprice',width:80,align:'right'">成本</th>
			<th data-define="field:'unitcost',width:80,align:'right'">单价</th>
			<th data-define="field:'attr1',width:100">属性</th>
			<th data-define="field:'status',width:60,align:'center'">状态</th>
		</tr>
	</thead>
</table>
<script type="text/javascript">
function setCustomerButton(){
	var pager = $('#dg_custompager').grid('getPager');
	pager.pagination({
	    buttons : [ {
	        iconCls : 'icon-search',
	        handler : function() {
		        alert('search');
	        }
	    }, {
	        iconCls : 'icon-add',
	        handler : function() {
		        alert('add');
	        }
	    }, {
	        iconCls : 'icon-edit',
	        handler : function() {
		        alert('edit');
	        }
	    } ]
	});
}
</script>
